package team.seekers.hula.course.resource.exam.entity.dao;

import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import team.seekers.hula.common.entity.BaseDO;

import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName(ExamDOField.TABLE_NAME)
public class ExamDO extends BaseDO {

    private static final long serialVersionUID = 1L;

    @TableId(value = ExamDOField.ID, type = IdType.ASSIGN_ID)
    private String id;

    @TableField(ExamDOField.COURSE_ID)
    private String courseId;

    @TableField(ExamDOField.SECTION_ID)
    private String sectionId;

    /**
     * 创建者id
     */
    @TableField(ExamDOField.USER_ID)
    private String userId;

    /**
     * 作业标题
     */
    @TableField(ExamDOField.TITLE)
    private String title;

    /**
     * 作业描述
     */
    @TableField(ExamDOField.DESCRIPTION)
    private String description;

    /**
     * 题目集合
     */
    @TableField(ExamDOField.PROBLEMS)
    private byte[] problems;

    /**
     * 题目总分
     */
    @TableField(ExamDOField.TOTAL_SCORE)
    private Integer totalScore;

    /**
     * 限制时长
     */
    @TableField(ExamDOField.LIMIT_DURATION)
    private Integer limitDuration;

    @TableField(ExamDOField.DELETED)
    @TableLogic(value = "0", delval = "1")
    private Integer deleted;

    @TableField(value = ExamDOField.GMT_CREATE, fill = FieldFill.INSERT)
    private Date gmtCreate;

    @TableField(value = ExamDOField.GMT_MODIFIED, fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;
}
